<%@page import="com.skeleton.db.dto.ShowinfoDto"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>项目进度展示</title>
	<script type="text/javascript" src="<%=request.getContextPath() %>/resource/jquery-1.8.2.js"></script>
	<style type="text/css">
		body {
			margin: 0px;
			padding: 0px;
			font-family: 微软雅黑;
		}
		
		.fl {
			float: left;
		}
		
		.cb {
			clear: both;
		}
		
		.menu {
			border-right: 1px dotted black;
			height: 600px;
		}
		
		.center {
			margin-left: 30px;
		}
		
		.head1 {
			font-size: 20px;
			font-weight: bold;
			margin-top: 20px;
		}
		
		.head2 {
			margin-left: 20px;
			font-size: 16px;
		}
		
		.div1 {
			margin-top: 10px;
			padding: 10px 20px 10px 20px;
			border: 1px solid red;
			font-size: 16px;
		}
		
		.div2 {
			margin-top: 10px;
			height: 49px;
		}
		
		.jiantou {
			background-image: url("<%=request.getContextPath() %>/resource/img1.jpg");
			width: 30px;
			height: 20px;
			margin-top: 13px;
			float: left;
		}
		
		.jianshen {
			background-image: url("<%=request.getContextPath() %>/resource/img2.jpg");
			width: 50px;
			height: 20px;
			margin-top: 13px;
		}
	</style>
	<script type="text/javascript">
		$(function() {
// 			$("li").click(function() {
// 				$("li ul").hide();
// 				$(this).children("ul").show(); 
// 			});
			$('.div1').each(function() {
				$(this).mouseover(function(e) {
					$(this).css({"border":"1px solid blue"});
					$(this).find("div").find("div").show();
				});
				$(this).mouseout(function() {
					$(this).css({"border":"1px solid red"});
					$(this).find("div").find("div").hide(); 
				});
			});
		});
	</script> 
</head>
<body>
	<h2>工程进度展示
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
	&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
		<a href="<%=request.getContextPath() %>/login" style="color: white;">后台登录</a> 
	</h2> 
	<hr /> 
	<div> 
		<div class="center fl">
			<%
				List<ShowinfoDto> list = (List<ShowinfoDto>)request.getAttribute("list");
				if(list != null) {
					for(int i=0; i<list.size(); i++) {
						ShowinfoDto dto = list.get(i);
						if(dto.getShowId().length() == 3) {
			%>
					<div class="head1"><%=dto.getShowTitle() %></div>
						<%
							for(int j=0; j<list.size(); j++) {
								ShowinfoDto dto2 = list.get(j);
								if(dto2.getShowId().length() == 6 && dto2.getShowId().substring(0, 3).equals(dto.getShowId())) {
						%>
							<div class="head2"><%=dto2.getShowTitle() %></div>
						<%	
									int nn = 0;
									for(int k=0; k<list.size(); k++) {
										ShowinfoDto dto3 = list.get(k);
										if(dto3.getShowId().length() == 9 && dto3.getShowId().substring(0, 6).equals(dto2.getShowId())) {
											if(nn!=0) {
						%>
											<div class="div2 fl">
												<div class="fl" style="width: 5px; height: 20px;"></div>
												<div class="jianshen fl"></div>
												<div class="jiantou fl"></div>
											</div>
						<%
											}
											nn++;
											if(dto3.getShowStatus() == '0') {
						%>
											<div class="div1 fl">
											<%
											}
											if(dto3.getShowStatus() == '1') {
											%>
											<div class="div1 fl" style="background-color: #00ff00">
											<%
											}
											if(dto3.getShowStatus() == '2') {
											%>
											<div class="div1 fl" style="background-color: #ff0000">
											<%
											}
											%>
												<%=dto3.getShowTitle() %>
												<div style="width: 1px; height: 1px;"> 
													<div style="width: 350px; padding: 10px 10px; border: 1px solid red; background-color: white; position: relative; left: -20px; top: 10px; display: none;">
														名称：<%=dto3.getShowTitle() %><hr />
														负责人（部门）：<%=dto3.getShowCommnet() %><hr />
														预计启动时间：<%=dto3.getStartDttmStr() %><br />
														预计结束时间：<%=dto3.getEndDttmStr() %><hr />
														备注：<%=dto3.getShowCommnet() %><hr />
														状态：
														<%
															char status = dto3.getShowStatus();
															if(status == '0') {
																out.print("新建");
															}
															if(status == '1') {
																out.print("完成<br />完成时间："+dto3.getFinishDttmStr());
															} 
															if(status == '2') {
																out.print("错误");
															}
														%>
													</div> 
												</div>
											</div>
						<%
										}
									}
						%>
									<div class="cb"></div>
						<%
								}
							}
						}
					}
				}
			%>
		</div>
	</div>
</body>
</html>